<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="common_header(title)">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title th:replace="${title}"></title>
<link href="../../static/css/bootstrap.min.css"
	th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet">
<script src="../../static/js/jquery-3.2.1.js"
	th:src="@{/static/js/jquery-3.2.1.js}"></script>
<script src="../../static/js/bootstrap.min.js"
	th:src="@{/static/js/bootstrap.min.js}"></script>
<script src="../../static/js/md5.js" th:src="@{/static/js/md5.js}"></script>
<script src="../../static/js/index.js" th:src="@{/static/js/index.js}"></script>
<style>
li {
	list-style-type: none;
}

html, body {
	height: 100%;
	font-size: 14px;
	color: #525252;
	font-family: NotoSansHans-Regular, AvenirNext-Regular, arial,
		Hiragino Sans GB, "Microsoft Yahei", "Hiragino Sans GB",
		"WenQuanYi Micro Hei", sans-serif;
	background: #f0f2f5;
}

.footer {
	background-color: #fff;
	margin-top: 22px;
	margin-bottom: 22px;
	width: 100%;
	padding-top: 22px;
	color: #8A8A8A;
	display: block;
	height: 200px;
	border: 1px;
	clear: both
}

.container {
	margin-right: 5%;
	margin-left: 5%;
	padding-left: 15px;
	padding-right: 15px;
	width: 40%;
	float: left;
}

.info {
	margin-right: 5%;
	width: 10%;
	float: left;
}

a {
	color: #8A8A8A;
	cursor: pointer;
}
</style>
</head>
<body>
	<header th:fragments="header">
		<!-- 这个是头部导航栏 -->
		<nav class="navbar navbar-default" role="navigation"
			style="background-color: white">
			<div class="container-fluid" style="margin-left: 10%">
				<div class="navbar-header">
					<a class="navbar-brand" href="<%%>">逍遥论坛</a>
				</div>
				<div>

					<!--向左对齐-->
					<ul class="nav navbar-nav navbar-left">
						<li>
							<!-- <c:if test="${tab.tab_name == '技术'}" --> <!-- class="active" -->
							<!--  </c:if> --> <a href="#">技术</a>
						</li>
					</ul>
					<!--未登录-->
					<ul class="nav navbar-nav navbar-right"
						th:if="${session.user==null}">
						<li>
							<p class="navbar-text">
								<a href="toLoginPage.do">登录</a>
							</p>
						</li>
						<li>
							<p class="navbar-text">
								<a href="toSignUpPage.do">注册</a>
							</p>
						</li>
					</ul>
					<!--已登录-->
					<ul class="nav navbar-nav navbar-right"
						th:if="${session.user!=null}" th:object="${session.user}">
						<li>
							<p class="navbar-text">
								<a href="toMainPage.do">首页</a>
							</p>
						</li>
						<!-- 被锁定的用户不能发贴 -->
						<li th:if="*{userStatus!=2}"><p class="navbar-text">
								<a href="toPublishTipPage.do">发表新贴</a>
							</p></li>

						<!-- 显示管理员功能下拉栏 -->
						<!--           <c:if test="${USER.user_type == 0 || USER.user_type == 1}"> -->
						<li class="dropdown" th:if="*{userType==0||userType==1}"><a
							href="#" class="dropdown-toggle" data-toggle="dropdown"
							role="button"> 管理员功能
						</a>
							<ul class="dropdown-menu">
								<!--  <c:if test="${USER.user_type == 0}"> -->
								<!-- 超级管理员可以注册新管理员 -->
								<li th:if="*{userType==0}"><a href="toSignUpPage.do">注册新的管理员</a></li>
								<li role="separator" class="divider" th:if="*{userType==0}"></li>
								<li><a href="toUserManagePage.do">用户管理</a></li>
								<!-- 分割线 -->
								<li role="separator" class="divider"></li>
								<li><a href="toTipManagePage.do?myTip=1">贴子管理</a></li>
								<li role="separator" class="divider"></li>
								<li><a href="toForumManagePage.do">版块管理</a></li>
								<li role="separator" class="divider"></li>
								<li><a href="toTabManagePage.do">分类管理</a></li>
								<li role="separator" class="divider"></li>
							</ul></li>
						<li>
						<li class="dropdown"><a href="#"
							class="dropdown-toggle" data-toggle="dropdown" role="button"
							aria-haspopup="true" aria-expanded="true" th:text="*{userName}">
								管理员功能<span class="caret" />
						</a>
							<ul class="dropdown-menu">
								<li><a th:href="'getUserInfo.do?userId='+*{userId}">个人中心</a></li>
								<li role="separator" class="divider"></li>

								<!-- 分割线 -->

								<li><a href="toTipManagePage.do?myTip=2">我的贴子</a></li>
								<li role="separator" class="divider"></li>

							</ul></li>
						<li>
							<p class="navbar-text" onclick="signOut_confirm()">
								<a th:href="userSignOut.do">退出登录</a>
							</p>
						</li>
					</ul>
				</div>
			</div>
		</nav>

	</header>
	<footer th:fragments="footer" class="footer">
		<div class="container">底部内容</div>
	</footer>
	<!-- <script>
		function signOut_confirm() {
			console.log("7676876786")
			var r = confirm("确定退出?")
			if (r == true) {
				window.location.href = "userSignOut.do";
			} else {
			}
		}
	</script> -->
</body>
</html>